package edu.gatech.mobile.scene.ui.manage;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import edu.gatech.mobile.scene.AppConstants;
import edu.gatech.mobile.scene.R;
import edu.gatech.mobile.scene.image.util.ImageGenerator;
import edu.gatech.mobile.scene.model.ImageInfo;
import edu.gatech.mobile.scene.provider.impl.ImageInfoDBImpl;
import edu.gatech.mobile.scene.provider.impl.ImageInfoTable;


/**
 * Activity for showing one single image with horizon drawn
 * @author Jing
 *
 */
public class ImageModelViewActivity extends Activity {
	private String imagePath;
	private ImageInfo imageInfo;
	private Bitmap horizonOverlay;
	private ImageInfoDBImpl imageDB;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.exif_data_viewer);
		imageDB = new ImageInfoDBImpl(this);
		
		imagePath = getIntent().getExtras().getString(
				AppConstants.BUNDLE_IMAGE_KEY);
		imageInfo = imageDB.getImageByName(imagePath);
		horizonOverlay = ImageGenerator.generateHorizonImagesColor(imageInfo);

		List<Bitmap> labels = new ArrayList<Bitmap>();

		ViewLabeledImageView view = new ViewLabeledImageView(this,
				horizonOverlay, labels);
		addContentView(view, new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.MATCH_PARENT));
	}

}
